import { observable, action } from 'mobx';
import { homePage } from '../fetch/apisetting';


class HomePage {
    @observable inProgress = false;
    @observable productData = [];
    @observable visible = false;
    @observable param={
        "id":JSON.parse(localStorage.getItem('userData'))?JSON.parse(localStorage.getItem('userData')).id :'',
        "type":"0"
    }
    @action getProductData(){
        this.inProgress=true
        return homePage.getProductData(this.param).then(
            action('getProductData',res=>{
                console.log(res)
                this.inProgress = false
                // this.total=res.totalCount
                this.productData=res.data
        })
        )
    }
    // @action editUser(){
    //     return transManage.editUser(this.addobj).then(
    //         action('editUser',res=>{
    //             window.success(res.errormsg)
                
    //             // this.getGusseData()
    //         })
    //     )
    // }
}

export default new HomePage();
